Go back to the About page.

Let us set some global options for all code chunks in this document.

knitr::opts_chunk$set(
  message = FALSE,    # Disable messages printed by R code chunks
  warning = FALSE,    # Disable warnings printed by R code chunks
  echo = TRUE,        # Show R code within code chunks in output
  include = TRUE,     # Include both R code and its results in output
  eval = TRUE,       # Evaluate R code chunks
  cache = FALSE,       # Enable caching of R code chunks for faster rendering
  fig.align = "center",
  out.width = "100%",
  retina = 2,
  error = TRUE,
  collapse = FALSE
)
rm(list = ls())
set.seed(1982)

1 Import libraries

library(MetricGraph)
library(dplyr)
library(plotly)

library(here)
library(rmarkdown)
library(grateful) # to cite

rm(list = ls()) # Clear the workspace
set.seed(1982) # Set seed for reproducibility

2 Building the graph object

V <- rbind(c(0, 0), c(1, 0), c(1, 1), c(0, 1), c(-1, 1), c(-1, 0), c(0, -1))
E <- rbind(c(1, 2), c(2, 3), c(3, 4), c(4, 5),
           c(5, 6), c(6, 1), c(4, 1),c(1, 7))
graph <- metric_graph$new(V = V, E = E)

3 Geodesic distance on a metric graph

Follow this link for an illustration of the geodesic distance on a metric graph.

4 Function on a metric graph

Follow this link for an illustration of a function on a metric graph.

5 Basis functions on a metric graph

Follow this link for alternative illustrations of basis functions on a metric graph.

Let each edge \(e\in\mathcal{E}\) be subdivided into \(n_{e}\geq 2\) regular segments of length \(h_{e}\), and be delimited by the nodes \(0 = x_0^{e},x_1^{e},\dots,x_{n_{e}-1}^{e}, x_{n_{e}}^{e} = \ell_{e}\). For each \(j = 1,\dots,n_{e}-1\), we consider the following standard hat basis functions \[\begin{equation*} \varphi_j^{e}(x)=\begin{cases} 1-\dfrac{|x_j^{e}-x|}{h_{e}},&\text{ if }x_{j-1}^{e}\leq x\leq x_{j+1}^{e},\\ 0,&\text{ otherwise}. \end{cases} \end{equation*}\] For each \(e\in\mathcal{E}\), the set of hat functions \(\left\{\varphi_1^{e},\dots,\varphi_{n_{e}-1}^{e}\right\}\) is a basis for the space \[\begin{equation*} V_{h_{e}} = \left\{w\in H_0^1(e)\;\Big|\;\forall j = 0,1,\dots,n_{e}-1:w|_{[x_j^{e}, x_{j+1}^{e}]}\in\mathbb{P}^1\right\}, \end{equation*}\] where \(\mathbb{P}^1\) is the space of linear functions on \([0,\ell_{e}]\). For each vertex \(v\in\mathcal{V}\), we define \[\begin{equation*} \mathcal{N}_v = \left\{\bigcup_{e\in\left\{e\in\mathcal{E}_v: v = x_0^e\right\}}[v,x_1^e]\right\}\bigcup\left\{\bigcup_{e\in\left\{e\in\mathcal{E}_v: v = x^e_{n_e}\right\}}[x^e_{n_e-1},v]\right\}, \end{equation*}\] which is a star-shaped set with center at \(v\) and rays made of the segments contiguous to \(v\). On \(\mathcal{N}_v\), we define the hat functions as \[\begin{equation*} \phi_v(x)=\begin{cases} 1-\dfrac{|x_v^{e}-x|}{h_{e}},&\text{ if }x\in\mathcal{N}_v\cap e \text{ and }e\in\mathcal{E}_v,\\ 0,&\text{ otherwise}, \end{cases} \end{equation*}\] where \(x_v^e\) is either \(x_0^e\) or \(x_{n_e}^e\) depending on the edge direction and its parameterization. See Arioli and Benzi (2018) for more. Figure 3 below provides an illustration of the system of basis functions \(\{\varphi_j^e, \phi_v\}\) together with the set \(\mathcal{N}_v\).


Press the Show button below to reveal the code.


# star set
d49 = data.frame(y = c(1/3,0), x = c(0,0), z = c(0,0))
d50 = data.frame(y = c(0,0), x = c(1/3,0), z = c(0,0))
d51 = data.frame(y = c(-1/3,0), x = c(0,0), z = c(0,0))
d52 = data.frame(y = c(0,0), x = c(-1/3,0), z = c(0,0))

graph_to_get_loc <- graph$clone()
graph_to_get_loc$build_mesh(h = 1/120)

loc <- graph_to_get_loc$get_mesh_locations()

graph$build_mesh(h = 1/3)

A <- graph$fem_basis(loc)

DD <- data.frame(A = as.matrix(A)) %>% 
  rowwise() %>%
  mutate(max_value = max(c_across(everything()))) %>%
  cbind(edge_number = loc[, 1], distance_on_edge = loc[, 2], A.24 = 0)

graph$add_observations(data = DD, normalized = TRUE)

# Initialize the first plot
p <- graph_to_get_loc$plot_function(X = DD[[paste0("A.", 1)]], line_color = "red",
                                     edge_width = 2, line_width = 2, support_width = 0.2, plotly = TRUE)
# Loop through to create the remaining plots
for (i in 2:24) {
  line_color <- "gray"
  if (i == 11) {line_color <- "blue"}
  if (i == 24) {line_color <- "black"}
  X <- DD[[paste0("A.", i)]]
  p <- graph_to_get_loc$plot_function(X = X, line_color = line_color, edge_width = 2, line_width = 2, support_width = 0.2, plotly = TRUE, p = p)
}

pp = p %>%  
  config(mathjax = 'cdn') %>% 
  layout(title = TeX("\\text{Basis functions on a metric graph }\\Gamma = (\\mathcal{V},\\mathcal{E})"), 
         showlegend = FALSE,
                    font = list(family = "Palatino"),
                    scene = list(
                      aspectratio = list(x = 1.8, y = 1.8, z = 0.4),
                      annotations = list(
                        list(
                          x = -1, y = 0, z = 0,
                          text = TeX("v_1"),
                          textangle = 0, ax = 0, ay = 25,
                          font = list(color = "black", size = 16),
                          arrowcolor = "black", arrowsize = 1, arrowwidth = 1,arrowhead = 1),
                        list(
                          x = 0, y = 0, z = 0,
                          text = TeX("v_2"),
                          textangle = 0, ax = 0, ay = 25,
                          font = list(color = "black", size = 16),
                          arrowcolor = "black", arrowsize = 1, arrowwidth = 1,arrowhead = 1),
                        list(
                          x = 0, y = -1, z = 0,
                          text = TeX("v_3"),
                          textangle = 0, ax = 0, ay = 25,
                          font = list(color = "black", size = 16),
                          arrowcolor = "black", arrowsize = 1, arrowwidth = 1,arrowhead = 1),
                        list(
                          x = 1, y = -1, z = 0,
                          text = TeX("v_4"),
                          textangle = 0, ax = 0, ay = 25,
                          font = list(color = "black", size = 16),
                          arrowcolor = "black", arrowsize = 1, arrowwidth = 1,arrowhead = 1),
                        list(
                          x = 1, y = 0, z = 0,
                          text = TeX("v_5"),
                          textangle = 0, ax = 0, ay = 25,
                          font = list(color = "black", size = 16),
                          arrowcolor = "black", arrowsize = 1, arrowwidth = 1,arrowhead = 1),
                        list(
                          x = 1, y = 1, z = 0,
                          text = TeX("v_6,x_0^{e_7}"),
                          textangle = 0, ax = 0, ay = 25,
                          font = list(color = "black", size = 16),
                          arrowcolor = "black", arrowsize = 1, arrowwidth = 1,arrowhead = 1),
                        list(
                          x = 0, y = 1, z = 0,
                          text = TeX("v_7,x_3^{e_7}"),
                          textangle = 0, ax = 0, ay = 25,
                          font = list(color = "black", size = 16),
                          arrowcolor = "black", arrowsize = 1, arrowwidth = 1,arrowhead = 1),
                        list(
                          x = 2/3, y = 1, z = 0,
                          text = TeX("x_1^{e_7}"),
                          textangle = 0, ax = 0, ay = 25,
                          font = list(color = "black", size = 16),
                          arrowcolor = "black", arrowsize = 1, arrowwidth = 1,arrowhead = 1),
                        list(
                          x = 1/3, y = 1, z = 0,
                          text = TeX("x_2^{e_7}"),
                          textangle = 0, ax = 0, ay = 25,
                          font = list(color = "black", size = 16),
                          arrowcolor = "black", arrowsize = 1, arrowwidth = 1,arrowhead = 1),
                        list(
                          x = 0.15, y = 0, z = 0,
                          text = TeX("\\mathcal{N}_{v_2}"),
                          textangle = 0, ax = 0, ay = 25,
                          font = list(color = "green", size = 16),
                          arrowcolor = "white", arrowsize = 1, arrowwidth = 1,arrowhead = 1),
                        list(
                          x = 2/3, y = 1, z = 1,
                          text = TeX("\\varphi_1^{e_7}"),
                          textangle = 0, ax = 0, ay = 75,
                          font = list(color = "blue", size = 16),
                          arrowcolor = "white", arrowsize = 1, arrowwidth = 1,arrowhead = 1),
                        list(
                          x = 0, y = 0, z = 1,
                          text = TeX("\\phi_{v_2}"),
                          textangle = 0, ax = 0, ay = 75,
                          font = list(color = "red", size = 16),
                          arrowcolor = "white", arrowsize = 1, arrowwidth = 1,arrowhead = 1)
                        ))) %>% 
  add_trace(x = 0, y = 0, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 0, y = 1, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 1, y = 1, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 1, y = 0, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 1, y = -1, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 0, y = -1, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = -1, y = 0, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = -2/3, y = 0, z = 0, mode = "markers", type = "scatter3d", # before this
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = -1/3, y = 0, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 0, y = -1/3, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 0, y = -2/3, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 1/3, y = -1, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 2/3, y = -1, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 0, y = 1/3, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 0, y = 2/3, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>% 
  add_trace(x = 1/3, y = 0, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 2/3, y = 0, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>% 
  add_trace(x = 1/3, y = 1, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 2/3, y = 1, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>% 
  add_trace(x = 1, y = 1/3, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 1, y = 2/3, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>% 
  add_trace(x = 1, y = -1/3, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>%
  add_trace(x = 1, y = -2/3, z = 0, mode = "markers", type = "scatter3d", 
            marker = list(size = 4, color = "blue", symbol = 104)) %>% 
  add_trace(data = d49, x = ~x, y = ~y, z = ~z, mode = "lines", type = "scatter3d",
            line = list(width = 3, color = "green", symbol = 104)) %>% 
  add_trace(data = d50, x = ~x, y = ~y, z = ~z, mode = "lines", type = "scatter3d",
            line = list(width = 3, color = "green", symbol = 104)) %>% 
  add_trace(data = d51, x = ~x, y = ~y, z = ~z, mode = "lines", type = "scatter3d",
            line = list(width = 3, color = "green", symbol = 104)) %>% 
  add_trace(data = d52, x = ~x, y = ~y, z = ~z, mode = "lines", type = "scatter3d",
            line = list(width = 3, color = "green", symbol = 104))

pp

Figure 3. Illustration of the system of basis functions \(\{\varphi_j^e, \phi_v\}\) (solid gray lines) on the graph \(\Gamma= (\mathcal{V},\mathcal{E})\), where \(\mathcal{E}= \left\{e_1,\dots,e_8\right\}\) and \(\mathcal{V}= \left\{v_1,\dots,v_7\right\}\). Note that for all \(e_i\in\mathcal{E}\), \(n_{e_i} = 3\) and \(h_{e_i} = 1/3\). In particular, for edge \(e_7\), observe that the three regular segments are delimited by the nodes \(v_6 = x_0^{e_7}, x_1^{e_7}, x_2^{e_7}, x_3^{e_7} = v_7\). Corresponding to node \(x_1^{e_7}\), we have plotted the basis function \(\varphi_1^{e_7}\) in blue. Notice also that the set \(\mathcal{N}_{v_2}\) is depicted in green and its corresponding basis function \(\phi_{v_2}\) is shown in red.

6 References

cite_packages(output = "paragraph", out.dir = ".")

We used R version 4.4.0 (R Core Team 2024) and the following R packages: ggtext v. 0.1.2 (Wilke and Wiernik 2022), gridExtra v. 2.3 (Auguie 2017), here v. 1.0.1 (Müller 2020), htmltools v. 0.5.8.1 (Cheng et al. 2024), INLA v. 24.6.27 (Rue, Martino, and Chopin 2009; Lindgren, Rue, and Lindström 2011; Martins et al. 2013; Lindgren and Rue 2015; De Coninck et al. 2016; Rue et al. 2017; Verbosio et al. 2017; Bakka et al. 2018; Kourounis, Fuchs, and Schenk 2018), inlabru v. 2.10.1.9010 (Yuan et al. 2017; Bachl et al. 2019), knitr v. 1.47 (Xie 2014, 2015, 2024), latex2exp v. 0.9.6 (Meschiari 2022), listviewer v. 4.0.0 (de Jong, Gainer, and Russell 2023), mapview v. 2.11.2 (Appelhans et al. 2023), Matrix v. 1.6.5 (Bates, Maechler, and Jagan 2024), MetricGraph v. 1.3.0.9000 (Bolin, Simas, and Wallin 2023b, 2023a, 2023c, 2024; Bolin et al. 2023), patchwork v. 1.2.0 (Pedersen 2024), plotly v. 4.10.4 (Sievert 2020), plotrix v. 3.8.4 (J 2006), reshape2 v. 1.4.4 (Wickham 2007), rmarkdown v. 2.27 (Xie, Allaire, and Grolemund 2018; Xie, Dervieux, and Riederer 2020; Allaire et al. 2024), rSPDE v. 2.3.3.9000 (Bolin and Kirchner 2020; Bolin and Simas 2023; Bolin, Simas, and Xiong 2023), scales v. 1.3.0 (Wickham, Pedersen, and Seidel 2023), sf v. 1.0.16 (Pebesma 2018; Pebesma and Bivand 2023), tidyverse v. 2.0.0 (Wickham et al. 2019), TSstudio v. 0.1.7 (Krispin 2023), xaringanExtra v. 0.8.0 (Aden-Buie and Warkentin 2024).

Aden-Buie, Garrick, and Matthew T. Warkentin. 2024. xaringanExtra: Extras and Extensions for xaringan Slides. https://CRAN.R-project.org/package=xaringanExtra.
Allaire, JJ, Yihui Xie, Christophe Dervieux, Jonathan McPherson, Javier Luraschi, Kevin Ushey, Aron Atkins, et al. 2024. rmarkdown: Dynamic Documents for r. https://github.com/rstudio/rmarkdown.
Appelhans, Tim, Florian Detsch, Christoph Reudenbach, and Stefan Woellauer. 2023. mapview: Interactive Viewing of Spatial Data in r. https://CRAN.R-project.org/package=mapview.
Arioli, Mario, and Michele Benzi. 2018. “A Finite Element Method for Quantum Graphs.” IMA Journal of Numerical Analysis 38 (3): 1119–63.
Auguie, Baptiste. 2017. gridExtra: Miscellaneous Functions for Grid Graphics. https://CRAN.R-project.org/package=gridExtra.
Bachl, Fabian E., Finn Lindgren, David L. Borchers, and Janine B. Illian. 2019. inlabru: An R Package for Bayesian Spatial Modelling from Ecological Survey Data.” Methods in Ecology and Evolution 10: 760–66. https://doi.org/10.1111/2041-210X.13168.
Bakka, Haakon, Håvard Rue, Geir-Arne Fuglstad, Andrea I. Riebler, David Bolin, Janine Illian, Elias Krainski, Daniel P. Simpson, and Finn K. Lindgren. 2018. “Spatial Modelling with INLA: A Review.” WIRES (Invited Extended Review) xx (Feb): xx–. http://arxiv.org/abs/1802.06350.
Bates, Douglas, Martin Maechler, and Mikael Jagan. 2024. Matrix: Sparse and Dense Matrix Classes and Methods. https://CRAN.R-project.org/package=Matrix.
Bolin, David, and Kristin Kirchner. 2020. “The Rational SPDE Approach for Gaussian Random Fields with General Smoothness.” Journal of Computational and Graphical Statistics 29 (2): 274–85. https://doi.org/10.1080/10618600.2019.1665537.
Bolin, David, Mihály Kovács, Vivek Kumar, and Alexandre B. Simas. 2023. “Regularity and Numerical Approximation of Fractional Elliptic Differential Equations on Compact Metric Graphs.” Mathematics of Computation. https://doi.org/10.1090/mcom/3929.
Bolin, David, and Alexandre B. Simas. 2023. rSPDE: Rational Approximations of Fractional Stochastic Partial Differential Equations. https://CRAN.R-project.org/package=rSPDE.
Bolin, David, Alexandre B. Simas, and Jonas Wallin. 2023a. “Markov Properties of Gaussian Random Fields on Compact Metric Graphs.” arXiv Preprint arXiv:2304.03190. https://doi.org/10.48550/arXiv.2304.03190.
———. 2023b. MetricGraph: Random Fields on Metric Graphs. https://CRAN.R-project.org/package=MetricGraph.
———. 2023c. “Statistical Inference for Gaussian Whittle-Matérn Fields on Metric Graphs.” arXiv Preprint arXiv:2304.10372. https://doi.org/10.48550/arXiv.2304.10372.
———. 2024. “Gaussian Whittle-Matérn Fields on Metric Graphs.” Bernoulli 30 (2): 1611–39. https://doi.org/10.3150/23-BEJ1647.
Bolin, David, Alexandre B. Simas, and Zhen Xiong. 2023. “Covariance-Based Rational Approximations of Fractional SPDEs for Computationally Efficient Bayesian Inference.” Journal of Computational and Graphical Statistics. https://doi.org/10.1080/10618600.2023.2231051.
Cheng, Joe, Carson Sievert, Barret Schloerke, Winston Chang, Yihui Xie, and Jeff Allen. 2024. htmltools: Tools for HTML. https://CRAN.R-project.org/package=htmltools.
De Coninck, Arne, Bernard De Baets, Drosos Kourounis, Fabio Verbosio, Olaf Schenk, Steven Maenhout, and Jan Fostier. 2016. Needles: Toward Large-Scale Genomic Prediction with Marker-by-Environment Interaction.” Genetics 203 (1): 543–55. https://doi.org/10.1534/genetics.115.179887.
de Jong, Jos, Mac Gainer, and Kent Russell. 2023. listviewer: htmlwidget for Interactive Views of r Lists. https://CRAN.R-project.org/package=listviewer.
J, Lemon. 2006. Plotrix: A Package in the Red Light District of r.” R-News 6 (4): 8–12.
Kourounis, D., A. Fuchs, and O. Schenk. 2018. “Towards the Next Generation of Multiperiod Optimal Power Flow Solvers.” IEEE Transactions on Power Systems PP (99): 1–10. https://doi.org/10.1109/TPWRS.2017.2789187.
Krispin, Rami. 2023. TSstudio: Functions for Time Series Analysis and Forecasting. https://CRAN.R-project.org/package=TSstudio.
Lindgren, Finn, and Håvard Rue. 2015. “Bayesian Spatial Modelling with R-INLA.” Journal of Statistical Software 63 (19): 1–25. http://www.jstatsoft.org/v63/i19/.
Lindgren, Finn, Håvard Rue, and Johan Lindström. 2011. “An Explicit Link Between Gaussian Fields and Gaussian Markov Random Fields: The Stochastic Partial Differential Equation Approach (with Discussion).” Journal of the Royal Statistical Society B 73 (4): 423–98.
Martins, Thiago G., Daniel Simpson, Finn Lindgren, and Håvard Rue. 2013. “Bayesian Computing with INLA: New Features.” Computational Statistics and Data Analysis 67: 68–83.
Meschiari, Stefano. 2022. Latex2exp: Use LaTeX Expressions in Plots. https://CRAN.R-project.org/package=latex2exp.
Müller, Kirill. 2020. here: A Simpler Way to Find Your Files. https://CRAN.R-project.org/package=here.
Pebesma, Edzer. 2018. Simple Features for R: Standardized Support for Spatial Vector Data.” The R Journal 10 (1): 439–46. https://doi.org/10.32614/RJ-2018-009.
Pebesma, Edzer, and Roger Bivand. 2023. Spatial Data Science: With applications in R. Chapman and Hall/CRC. https://doi.org/10.1201/9780429459016.
Pedersen, Thomas Lin. 2024. patchwork: The Composer of Plots. https://CRAN.R-project.org/package=patchwork.
R Core Team. 2024. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.
Rue, Håvard, Sara Martino, and Nicholas Chopin. 2009. “Approximate Bayesian Inference for Latent Gaussian Models Using Integrated Nested Laplace Approximations (with Discussion).” Journal of the Royal Statistical Society B 71: 319–92.
Rue, Håvard, Andrea I. Riebler, Sigrunn H. Sørbye, Janine B. Illian, Daniel P. Simpson, and Finn K. Lindgren. 2017. “Bayesian Computing with INLA: A Review.” Annual Reviews of Statistics and Its Applications 4 (March): 395–421. http://arxiv.org/abs/1604.00860.
Sievert, Carson. 2020. Interactive Web-Based Data Visualization with r, Plotly, and Shiny. Chapman; Hall/CRC. https://plotly-r.com.
Verbosio, Fabio, Arne De Coninck, Drosos Kourounis, and Olaf Schenk. 2017. “Enhancing the Scalability of Selected Inversion Factorization Algorithms in Genomic Prediction.” Journal of Computational Science 22 (Supplement C): 99–108. https://doi.org/10.1016/j.jocs.2017.08.013.
Wickham, Hadley. 2007. “Reshaping Data with the reshape Package.” Journal of Statistical Software 21 (12): 1–20. http://www.jstatsoft.org/v21/i12/.
Wickham, Hadley, Mara Averick, Jennifer Bryan, Winston Chang, Lucy D’Agostino McGowan, Romain François, Garrett Grolemund, et al. 2019. “Welcome to the tidyverse.” Journal of Open Source Software 4 (43): 1686. https://doi.org/10.21105/joss.01686.
Wickham, Hadley, Thomas Lin Pedersen, and Dana Seidel. 2023. scales: Scale Functions for Visualization. https://CRAN.R-project.org/package=scales.
Wilke, Claus O., and Brenton M. Wiernik. 2022. ggtext: Improved Text Rendering Support for ggplot2. https://CRAN.R-project.org/package=ggtext.
Xie, Yihui. 2014. knitr: A Comprehensive Tool for Reproducible Research in R.” In Implementing Reproducible Computational Research, edited by Victoria Stodden, Friedrich Leisch, and Roger D. Peng. Chapman; Hall/CRC.
———. 2015. Dynamic Documents with R and Knitr. 2nd ed. Boca Raton, Florida: Chapman; Hall/CRC. https://yihui.org/knitr/.
———. 2024. knitr: A General-Purpose Package for Dynamic Report Generation in r. https://yihui.org/knitr/.
Xie, Yihui, J. J. Allaire, and Garrett Grolemund. 2018. R Markdown: The Definitive Guide. Boca Raton, Florida: Chapman; Hall/CRC. https://bookdown.org/yihui/rmarkdown.
Xie, Yihui, Christophe Dervieux, and Emily Riederer. 2020. R Markdown Cookbook. Boca Raton, Florida: Chapman; Hall/CRC. https://bookdown.org/yihui/rmarkdown-cookbook.
Yuan, Yuan, Bachl, Fabian E., Lindgren, Finn, Borchers, et al. 2017. “Point Process Models for Spatio-Temporal Distance Sampling Data from a Large-Scale Survey of Blue Whales.” Ann. Appl. Stat. 11 (4): 2270–97. https://doi.org/10.1214/17-AOAS1078.